<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{layouts/layout}">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <meta name="_csrf" th:content="${_csrf.token}"/>
    <meta name="_csrf_header" th:content="${_csrf.headerName}"/>
    <title>用户管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">

    <!-- Open Sans font from Google CDN -->

    <!-- Pixel Admin's stylesheets -->
    <link href="assets/stylesheets/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="assets/stylesheets/pixel-admin.min.css" rel="stylesheet" type="text/css">
    <link href="assets/stylesheets/widgets.min.css" rel="stylesheet" type="text/css">
    <link href="assets/stylesheets/rtl.min.css" rel="stylesheet" type="text/css">
    <link href="assets/stylesheets/themes.min.css" rel="stylesheet" type="text/css">


    <link th:href="@{assets/javascripts/pagination/pagination.css}" rel="stylesheet" type="text/css" />


    <!--[if lt IE 9]>
    <script src="assets/javascripts/ie.min.js"></script>
    <![endif]-->

</head>
<body class="theme-default main-menu-animated">

<script>var init = [];</script>


<th:block layout:fragment="content">
    <div class="col-xs-12 col-sm-12">
        <table id="ordertable" class="table table-bordered table-hover">
            <thead>
            <tr>
                <th>#</th>
                <th>单号</th>
                <th>订购时间</th>
                <th>产品名称</th>
                <th>规格</th>
                <th>型号</th>
                <th>联系人</th>
                <th>手机</th>
                <th>收货地址</th>
                <th>留言</th>
                <th>提交IP</th>
                <th>状态</th>
                <th>处理</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="order,inx :${orders}">
                <td th:text="${inx.index}">1</td>
                <td th:text="${order.id}">Mark</td>
                <td th:text="${#dates.format(order.getCreatedAt(),'yyyy-MM-dd HH:mm:ss')}"></td>
                <td th:text="${order.productname}"></td>
                <td th:text="${order.pricename}">Mark</td>
                <td th:text="${order.stylename}">Mark</td>
                <td th:text="${order.username}">1</td>
                <td th:text="${order.mobile}">1</td>
                <td th:text="${order.addr}">1</td>
                <td th:text="${order.message}">1</td>
                <td th:text="${order.ip}">@mdo</td>
                <td>
                    <select th:id="${'select_'+order.id}">
                        <option th:each="state ,index : ${T(com.hubin.mode.enums.OrderStatus).values()}"
                                th:value="${state.name()}"
                                th:text="${state}"
                                th:selected="${state == order.status}"
                        >
                        </option>
                    </select>
                </td>
                <td>
                    <button  class="btn btn-info"  th:onclick="'javascript:editorder(this,'+${order.id}+');'" >修改</button> &nbsp;&nbsp;
                </td>
            </tr>

            </tbody>
        </table>
    </div>
    <div class="tableFootLine">
        <div class="pagebarList pagination"/>
    </div>
</th:block>
<!-- Get jQuery from Google CDN -->
<script src="assets/javascripts/jquery-1.10.2.min.js"></script>


<!-- Pixel Admin's javascripts -->
<script src="assets/javascripts/bootstrap.min.js"></script>
<script src="assets/javascripts/pixel-admin.min.js"></script>
<script th:src="@{assets/javascripts/pagination/jquery.pagination.js}"></script>
<script type="text/javascript">
    init.push(function () {

        $("#logout").click(function () {
            if (confirm('您确定退出吗？')) {
                $("#logoutform").submit();
            }
        });

    })
    window.PixelAdmin.start(init);

    $(function () {
        var token = $("meta[name='_csrf']").attr("content");
        var header = $("meta[name='_csrf_header']").attr("content");
        $(document).ajaxSend(function(e, xhr, options) {
            xhr.setRequestHeader(header, token);
        });
    });
</script>

</body>
</html>